﻿using FluentNHibernate.Mapping;
using Kratos.Framework.ContentManagement.Models;
using Kratos.Framework.ContentManagement.Models.Order;

namespace Kratos.Framework.ContentManagement.Maps.Order
{
    public class OrderMap : ClassMap<Orders>
    {
        public OrderMap()
        {
            Id(m => m.OrderId).GeneratedBy.Identity();

            Map(m => m.OrderDate);

            Map(m => m.TotalAmount);

            HasMany<LineItem>(m => m.Items).AsBag();

            References<UserInfo>(m => m.User).Column("UserId");
        }
    }
}
